package com.chao.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * @author Luck Chao
 * @Date: 2021/12/12
 */
@Slf4j
@RestController
@RequestMapping
@Api(produces="application/json",tags = WebController.TAGS,consumes="application/json")
public class WebController {

    protected static final String TAGS = "API-数据交互测试接口";


    @GetMapping(value = "/index")
    @ApiOperation(tags = TAGS, value = "初始化页面", notes = "初始化页面", response = String.class)
    public String test(HttpServletRequest request) {
        log.info(">>>>>>>>>>>>>> start index >>>>>>>>>");
        log.info(">>>>>>>>>>>>>> request: {} ", request);
        return "hello world";
    }

@GetMapping(value = "/add")
    @ApiOperation(tags = TAGS, value = "初始化页面", notes = "初始化页面", response = String.class)
    public String testAdd(HttpServletRequest request, @RequestParam String str) {
        log.info(">>>>>>>>>>>>>> start testAdd >>>>>>>>>");
        log.info(">>>>>>>>>>>>>> request: {} ", request);
        return "hello world";
    }



}
